<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<!--后台一级导航栏-->
<nav class="ui inverted attached segment m-padded-tb-mini m-shadow-small" th:fragment="menu">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <a th:href="@{/admin/index}" class="ui">
                <h2 class="ui teal header item">后台</h2>
            </a>

            <a th:href="@{/index.html}" target="_blank" class="item m-mobile-hidden m-item">
                <i class="small home icon"></i>前台
            </a>

            <a th:href="@{/admin/blogs}" class="item m-mobile-hidden m-item"
               th:classappend="${activeUrl == 'blogs.html'} ? 'active'">
                <i class="small book icon"></i>博客管理
            </a>

            <a th:href="@{/admin/blogs/addBlog}" class="item m-mobile-hidden m-item"
               th:classappend="${activeUrl == 'post.html'} ? 'active'">
                <i class="small edit icon"></i>撰写文章
            </a>

            <a th:href="@{/admin/types}" class="item m-mobile-hidden m-item"
               th:classappend="${activeUrl == 'types.html'} ? 'active'">
                <i class="small bookmark icon"></i>分类管理
            </a>

            <a th:href="@{/admin/tags}" class="item m-mobile-hidden m-item"
               th:classappend="${activeUrl == 'tags.html'} ? 'active'">
                <i class="small tags icon"></i>标签管理
            </a>

            <div class="right menu m-item m-mobile-hidden">
                <div class="ui dropdown item">
                    <div class="text">
                        <img class="ui avatar image" th:if="${session.loginUser != null}"
                             th:src="${session.loginUser.avatar}">
                        <span th:if="${session.loginUser != null}"
                              th:text="${session.loginUser.username}">admin</span>
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a th:href="@{/logout}" class="ui item"><i class="ui sign-out icon"></i>退出登录</a>
                    </div>
                </div>
            </div>

            <a href="#" class="ui black icon button m-right-top m-mobile-show menu toggle">
                <i class="sidebar icon"></i>
            </a>


        </div>

    </div>
</nav>


<!--后台二级导航-->
<!--
<div class="ui attached menu" th:fragment="secondaryMenu">
    <div class="ui container">
        <div class="right menu">
            <a th:href="@{/admin/blogs}" class="item" th:classappend="${smenu == 'blogs.html'} ? 'active blue'">博客列表</a>
        </div>
    </div>
</div>
-->

<!--后台的js-->
<th:block th:fragment="script">
    <!--jQuery 必须放在 editormd 前面-->
    <script th:src="@{/js/jquery-3.4.1.min.js}"></script>
    <script th:src="@{/js/semantic.min.js}"></script>
    <!--引入 md 插件-->
    <script th:src="@{/lib/editormd/editormd.min.js}"></script>
    <script>
        $(function () {
            $('#newBlog-container').load('/footerBlog');
        });

    </script>
</th:block>


</html>